Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print all requests to console in debug mode #4365

Merged
merged 4 commits into from
Dec 18, 2024

Conversation

wooj-stripe
Copy link
Collaborator

Summary

It's kind of difficult to see when requests are failing. I propose we print requestID to the console so that it's easier to see/debug.

Motivation

Difficult to view requestId's unless you have a ton of breakpoints in code.

Testing

Manual testing.

Changelog

@wooj-stripe wooj-stripe marked this pull request as ready for review December 17, 2024 01:42
@wooj-stripe wooj-stripe requested review from a team as code owners December 17, 2024 01:42
davidme-stripe
davidme-stripe previously approved these changes Dec 17, 2024
@davidme-stripe
Copy link
Contributor

Good idea!

@wooj-stripe
Copy link
Collaborator Author

Changed the approach to log on all requests, and print out the url's relative path. For example, output looks like:

[Stripe SDK]: Request req_T3UJiX9Rbhlh8V, /v1/elements/sessions
[Stripe SDK]: Request req_hM8KJQuvSUvI9r, /v1/customers/cus_RQ08km9gxe2npT

mats-stripe
mats-stripe previously approved these changes Dec 18, 2024
Copy link
Collaborator

@mats-stripe mats-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, might steal this for the FC API client!

Just curious, can users do anything with these request IDs that might help them debug an error? Or is this ID just something we can use internally to debug?

@wooj-stripe wooj-stripe changed the title Print failed requests to console in debug mode Print all requests to console in debug mode Dec 18, 2024
@wooj-stripe
Copy link
Collaborator Author

Nice, might steal this for the FC API client!

Just curious, can users do anything with these request IDs that might help them debug an error? Or is this ID just something we can use internally to debug?

I believe uses can log into their dashboard and access request logs based on requestID, but the idea is if they open an issue w/ us and include requests, we'd have more info on figuring out what's going on.

davidme-stripe
davidme-stripe previously approved these changes Dec 18, 2024
@wooj-stripe wooj-stripe enabled auto-merge (squash) December 18, 2024 22:29
@wooj-stripe wooj-stripe merged commit 9472712 into master Dec 18, 2024
6 checks passed
@wooj-stripe wooj-stripe deleted the wooj/printFailedRequests branch December 18, 2024 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants